<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Position</title>
    <style>
      *{
        margin: 0;
        padding: 0;
        list-style: none;
      }
      .parent{
        position: relative;
        margin: 0 auto;
        margin-top: 200px;
        width: 300px;
        height: 300px;
        background-color: hotpink;
      }
      .child{
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        margin:auto;
        /* clip: rect(auto); */
        clip: rect(0 auto 150px 10px);  /* 对应上右下左，四个方向剪切的开始位置（剪切直至元素此方向最大像素），auto为不剪切，貌似没什么卵用 */
        width: 200px;
        height: 200px;
        background-color: yellowgreen;
      }
    </style>
  </head>
  <body>
    <div class="parent">
      <div class="child" style="color: red;">
        使用clip被切剪后的效果
      </div>
    </div>
  </body>
</html>